﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
    /// <summary>
    /// 对应数据库中 order_detail 表（从截图看表名包含 order_detail ，按实际为准）的实体类
    /// </summary>
    public class OmPurchaseOrderDetail
    {
        /// <summary>
        /// 进货明细ID，对应数据库表中 up_detail_id 列，类型 bigint
        /// </summary>
        [Key]
        public long UpDetailId { get; set; }

        /// <summary>
        /// 进货订单ID，对应 up_order_id 列，类型 bigint
        /// </summary>
        public long UpOrderId { get; set; }

        /// <summary>
        /// 货品编号，对应 goods_code 列，类型 varchar(50)
        /// </summary>
        public string GoodsCode { get; set; }

        /// <summary>
        /// 货品类型ID，对应 goods_type_id 列，类型 bigint
        /// </summary>
        public long GoodsTypeId { get; set; }

        /// <summary>
        /// 采购单价，对应 purchase_unit_price 列，类型 decimal(18, 2)
        /// </summary>
        public decimal PurchaseUnitPrice { get; set; }

        /// <summary>
        /// 订单数量，对应 order_quantity 列，类型 decimal(18, 2)
        /// </summary>
        public decimal OrderQuantity { get; set; }

        /// <summary>
        /// 已入库数量，对应 received_quantity 列，类型 decimal(18, 2)
        /// </summary>
        public decimal ReceivedQuantity { get; set; }

        /// <summary>
        /// 已退货数量，对应 returned_quantity 列，类型 decimal(18, 2)
        /// </summary>
        public decimal ReturnedQuantity { get; set; }

        /// <summary>
        /// 是否删除，对应 is_delete 列，类型 char(1)
        /// </summary>
        public string IsDelete { get; set; }

        /// <summary>
        /// 附件ID，对应 attachment_code 列，类型 string
        /// </summary>
        public string AttachmentCode { get; set; }

        /// <summary>
        /// 备注，对应 remarks 列，类型 varchar(500)
        /// </summary>
        public string Remarks { get; set; }
    }

    /// <summary>
    /// 进货订单明细(新增)
    /// </summary>
    public class OmPurchaseOrderDetailForAdd
    {
        //进货订单ID
        public long UpOrderId { get; set; }

        //商品编号
        public string GoodsCode { get; set; }

        //商品类型ID
        public long GoodsTypeId { get; set; }

        //进货单价
        public decimal PurchaseUnitPrice { get;set; }

        //货品数量
        public decimal OrderQuantity { get; set; }

        //附件ID
        public string AttachmentCode{ get; set; }

        //备注
        public string Remarks{ get; set; }
    }
}
